home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Iscripts / DHTML - Mouse and Cursor / dancing-stars.izs < prev    next >
Text File  |  2005-09-02  |  7KB  |  218 lines

  1. <!NOWIZARD>
  2.  
  3. <!TITLE>Dancing Stars Cursor
  4. <!/TITLE>
  5.  
  6. <!BROWSER>IE5+ Opr7+<!/BROWSER>
  7.  
  8. <!DESCRIPTION> One of the many cursor scripts in our archive, this one produces dancing stars animating around your mouse. The script uses NO images, so the effect is extremely lightweight and easy to customize.
  9. <!/DESCRIPTION> 
  10.  
  11. <!CATEGORY>mouse and cursor<!/CATEGORY>
  12.  
  13. <!SCRIPT>
  14. <!-- START OF SCRIPT -->
  15. <LAYER NAME="a0" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3"></LAYER>
  16. <LAYER NAME="a1" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3"></LAYER>
  17. <LAYER NAME="a2" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3"></LAYER>
  18. <LAYER NAME="a3" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3"></LAYER>
  19. <LAYER NAME="a4" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3"></LAYER>
  20. <LAYER NAME="a5" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3"></LAYER>
  21. <LAYER NAME="a6" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3"></LAYER>
  22.  
  23. <script language="JavaScript">
  24. <!--
  25.  
  26. /*
  27. Dancing Stars cursor (Submitted by Kurt at kurt.grigg@virgin.net)
  28. Modified and permission granted to Dynamic Drive to feature script in archive
  29. For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
  30. */
  31.  
  32. if (document.all){
  33. document.write('<div id="starsDiv" style="position:absolute;top:0px;left:0px">')
  34. for (xy=0;xy<7;xy++)
  35. document.write('<div style="position:relative;width:3px;height:3px;background:#FFFF00;font-size:2px;visibility:visible"></div>')
  36. document.write('</div>')
  37. }
  38.  
  39. if (document.layers)
  40. {window.captureEvents(Event.MOUSEMOVE);}
  41. var yBase = 200;
  42. var xBase = 200;
  43. var yAmpl = 10;
  44. var yMax = 40;
  45. var step = .2;
  46. var ystep = .5;
  47. var currStep = 0;
  48. var tAmpl=1;
  49. var Xpos = 1;
  50. var Ypos = 1;
  51. var i = 0;
  52. var j = 0;
  53.  
  54. if (document.all)
  55. {
  56.   function MoveHandler(){
  57.   Xpos = document.body.scrollLeft+event.x;
  58.   Ypos = document.body.scrollTop+event.y;
  59.   }
  60.   document.onmousemove = MoveHandler; 
  61. }
  62.  
  63. else if (document.layers)
  64. {
  65.   function xMoveHandler(evnt){
  66.   Xpos = evnt.pageX;
  67.   Ypos = evnt.pageY;
  68.   }
  69.   window.onMouseMove = xMoveHandler;
  70. }
  71.  
  72.  
  73.  
  74. function animateLogo() {
  75. if (document.all)
  76. {
  77.  yBase = window.document.body.offsetHeight/4;
  78.  xBase = window.document.body.offsetWidth/4;
  79. }
  80. else if (document.layers)
  81. {
  82.  yBase = window.innerHeight/4 ;
  83.  xBase = window.innerWidth/4;
  84. }
  85.  
  86. if (document.all)
  87. {
  88. var totaldivs=document.all.starsDiv.all.length
  89.  for ( i = 0 ; i < totaldivs ; i++ )
  90.  {
  91. var tempdiv=document.all.starsDiv.all[i].style
  92.   tempdiv.top = Ypos + Math.cos((20*Math.sin(currStep/20))+i*70)*yBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + i*25)/10);
  93.   tempdiv.left = Xpos + Math.sin((20*Math.sin(currStep/20))+i*70)*xBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + i*25)/10);
  94.  }
  95. }
  96.  
  97. else if (document.layers)
  98. {
  99.  for ( j = 0 ; j < 7 ; j++ ) 
  100.  {
  101. var templayer="a"+j
  102.   document.layers[templayer].top = Ypos + Math.cos((20*Math.sin(currStep/20))+j*70)*yBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + j*25)/10);
  103.   document.layers[templayer].left =Xpos + Math.sin((20*Math.sin(currStep/20))+j*70)*xBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + j*25)/10);
  104.  }
  105. }
  106. currStep += step;
  107. setTimeout("animateLogo()", 15);
  108. }
  109. animateLogo();
  110. // -->
  111. </script>
  112. <!-- END OF SCRIPT -->
  113. <!/SCRIPT>
  114.  
  115. <!PREVIEW>
  116. <!-- START OF SCRIPT -->
  117. <LAYER NAME="a0" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3"></LAYER>
  118. <LAYER NAME="a1" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3"></LAYER>
  119. <LAYER NAME="a2" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3"></LAYER>
  120. <LAYER NAME="a3" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3"></LAYER>
  121. <LAYER NAME="a4" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3"></LAYER>
  122. <LAYER NAME="a5" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3"></LAYER>
  123. <LAYER NAME="a6" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3"></LAYER>
  124.  
  125. <script language="JavaScript">
  126. <!--
  127.  
  128. /*
  129. Dancing Stars cursor (Submitted by Kurt at kurt.grigg@virgin.net)
  130. Modified and permission granted to Dynamic Drive to feature script in archive
  131. For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
  132. */
  133.  
  134. if (document.all){
  135. document.write('<div id="starsDiv" style="position:absolute;top:0px;left:0px">')
  136. for (xy=0;xy<7;xy++)
  137. document.write('<div style="position:relative;width:3px;height:3px;background:#FFFF00;font-size:2px;visibility:visible"></div>')
  138. document.write('</div>')
  139. }
  140.  
  141. if (document.layers)
  142. {window.captureEvents(Event.MOUSEMOVE);}
  143. var yBase = 200;
  144. var xBase = 200;
  145. var yAmpl = 10;
  146. var yMax = 40;
  147. var step = .2;
  148. var ystep = .5;
  149. var currStep = 0;
  150. var tAmpl=1;
  151. var Xpos = 1;
  152. var Ypos = 1;
  153. var i = 0;
  154. var j = 0;
  155.  
  156. if (document.all)
  157. {
  158.   function MoveHandler(){
  159.   Xpos = document.body.scrollLeft+event.x;
  160.   Ypos = document.body.scrollTop+event.y;
  161.   }
  162.   document.onmousemove = MoveHandler; 
  163. }
  164.  
  165. else if (document.layers)
  166. {
  167.   function xMoveHandler(evnt){
  168.   Xpos = evnt.pageX;
  169.   Ypos = evnt.pageY;
  170.   }
  171.   window.onMouseMove = xMoveHandler;
  172. }
  173.  
  174.  
  175.  
  176. function animateLogo() {
  177. if (document.all)
  178. {
  179.  yBase = window.document.body.offsetHeight/4;
  180.  xBase = window.document.body.offsetWidth/4;
  181. }
  182. else if (document.layers)
  183. {
  184.  yBase = window.innerHeight/4 ;
  185.  xBase = window.innerWidth/4;
  186. }
  187.  
  188. if (document.all)
  189. {
  190. var totaldivs=document.all.starsDiv.all.length
  191.  for ( i = 0 ; i < totaldivs ; i++ )
  192.  {
  193. var tempdiv=document.all.starsDiv.all[i].style
  194.   tempdiv.top = Ypos + Math.cos((20*Math.sin(currStep/20))+i*70)*yBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + i*25)/10);
  195.   tempdiv.left = Xpos + Math.sin((20*Math.sin(currStep/20))+i*70)*xBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + i*25)/10);
  196.  }
  197. }
  198.  
  199. else if (document.layers)
  200. {
  201.  for ( j = 0 ; j < 7 ; j++ ) 
  202.  {
  203. var templayer="a"+j
  204.   document.layers[templayer].top = Ypos + Math.cos((20*Math.sin(currStep/20))+j*70)*yBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + j*25)/10);
  205.   document.layers[templayer].left =Xpos + Math.sin((20*Math.sin(currStep/20))+j*70)*xBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + j*25)/10);
  206.  }
  207. }
  208. currStep += step;
  209. setTimeout("animateLogo()", 15);
  210. }
  211. animateLogo();
  212. // -->
  213. </script>
  214.  
  215. <!-- END OF SCRIPT -->
  216. <!/PREVIEW>
  217.  
  218. <!RELATED>NONE<!/RELATED>